home *** CD-ROM | disk | FTP | other *** search
/ Compendium Deluxe 2 / LSD and 17bit Compendium Deluxe - Volume II.iso / a / prog / asmsrc / tangosources.lha / misc_sources / copperflight.s < prev    next >
Encoding:
Text File  |  2008-06-03  |  3.9 KB  |  154 lines

  1. *****************************************************************************
  2. *                        COPPER FLIGHT BAR TANGO/XENTRIX                        *
  3. *****************************************************************************
  4.     
  5.     section copperbars,code_c
  6.     opt c-
  7.     incdir    df1:
  8.     include    gamemacros
  9.  
  10.  
  11. *****************************************************************************
  12. *                    KILL O/S AND CALL ROUTINES AND TEST MOUSE                *
  13. *****************************************************************************
  14.  
  15.     killsys
  16.     move.l    #newcopper,$dff080
  17.     lea        custom,a5
  18. mouse:
  19.     cmp.b    #$ff,$dff006
  20.     bne.s    mouse
  21.     move.w    #$fff,$dff180
  22.     bsr        doform
  23.     move.w    #$0,$dff180
  24.     btst    #6,$bfe001
  25.     bne.s    mouse
  26.     ressys
  27.     clr.l    d0
  28.     rts
  29.  
  30.                                                                                                                                                                     
  31. *****************************************************************************
  32. *                            BLIT THE COPPER BARS                            *
  33. *****************************************************************************
  34.  
  35. blitbar:
  36.     lea        coltab(pc),a1
  37.     lea        dest+6(pc),a2                ; point to colour 
  38.     lea        bltapth(a5),a3
  39.     lea        bltdpth(a5),a4
  40.     lea        bltsize(a5),a0
  41.     lea        bltcon0(a5),a6
  42.     move.l    #-1,d6
  43.     moveq    #0,d4
  44.     moveq    #6,d5
  45.     add.l    d1,a2                        ; d1 holds position of bar
  46.     blitwait
  47.     move.w    d4,bltamod(a5)
  48.     move.w    d5,bltdmod(a5)                ; 6  (3words to next colour)
  49.     move.l    d6,bltafwm(a5)
  50.     move.l    a1,(a3)                        ; source
  51.     move.l    a2,(a4)                        ; dest
  52.     move.l    #$09f00000,(a6)                ; minterm D=A
  53.     move.w    #32<<6!1,(a0)                ; blitsize
  54.     rts
  55.  
  56.  
  57. *****************************************************************************
  58. *                    MOVE THE COPPER BARS FROM A SINE TABLE                    *
  59. *****************************************************************************
  60.  
  61. doform:
  62.     move.l    sinptr(pc),a2    ; pointer to sine table
  63.     move.l    tabptr(pc),a0    ; pointer to table
  64.     move.w    (a0)+,d7        ; amount of bars
  65. barlooper:
  66.     move.w    (a0)+,d1        ; position in sinetab
  67.     add.w    d1,d1            ; even
  68.     and.w    #$fe,d1
  69.     move.w    (a2,d1),d1        ; got position
  70.     asl.l    #3,d1            ; times by 8 for next line down!
  71.     move.w    (a0)+,d2
  72.     add.w    d2,-4(a0)        ; speed
  73.     save_all
  74.     bsr        blitbar
  75.     return_all
  76.     dbf        d7,barlooper
  77.     rts
  78.  
  79.  
  80. *****************************************************************************
  81. *                        COPPER LIST (JUST A BIG REPEAT!)                    *
  82. *****************************************************************************
  83.  
  84. newcopper:
  85.     cmove    bplcon0,$0200
  86. a    set    50
  87. dest:
  88.     rept    180
  89.     dc.b    a,$09,$ff,$fe
  90.     dc.w    $180,$00            ; CHANGE THIS COL!!!
  91. a    set        a+1
  92.     endr
  93.     dc.w    $ffff,$fffe
  94.     
  95.  
  96. *****************************************************************************
  97. *           COLOURS FOR BAR (NOTE BAR IS 34 LINES, HENCE 34 COLOURS!)        *
  98. *****************************************************************************
  99.  
  100. coltab:
  101.     dc.w    $000,$000,$001,$002,$003,$004,$005,$006,$007
  102.     dc.w    $008,$009,$00a,$00b,$00c,$00d,$00e,$00f
  103.     dc.w    $00e,$00d,$00c,$00b,$00a,$009,$008,$007,$006
  104.     dc.w    $005,$004,$003,$002,$001,$000
  105.  
  106.  
  107.     
  108. *****************************************************************************
  109. *                             BAR FORMATIONS!                                *
  110. *****************************************************************************
  111.  
  112. tabptr:
  113.     dc.l    tab
  114. tab:
  115.     dc.w    10-1                ; no of bars to blit
  116.     dc.w    10,1                ; offset to sine tab and speed
  117.     dc.w    20,1                ; offset to sine tab and speed
  118.     dc.w    30,1
  119.     dc.w    40,1
  120.     dc.w    50,1
  121.     dc.w    60,1
  122.     dc.w    70,1
  123.     dc.w    80,1
  124.     dc.w    90,1
  125.     dc.w    100,1
  126.  
  127.  
  128. *****************************************************************************
  129. *                            THE MEGA SINE TABLE                                *
  130. *****************************************************************************
  131.  
  132. sinptr:    
  133.         dc.l    sintab
  134. sintab:
  135.     dc.w    120,120,120,119,119,118,117,116
  136.     dc.w    115,114,113,111,110,108,106,104
  137.     dc.w    102,100,98,96,93,91,88,86
  138.     dc.w    83,80,77,75,72,69,66,63
  139.     dc.w    60,57,54,51,48,45,43,40
  140.     dc.w    37,34,32,29,27,24,22,20
  141.     dc.w    18,16,14,12,10,9,7,6
  142.     dc.w    5,4,3,2,1,1,0,0
  143.     dc.w    0,0,0,1,1,2,3,4
  144.     dc.w    5,6,7,9,10,12,14,16
  145.     dc.w    18,20,22,24,27,29,32,34
  146.     dc.w    37,40,43,45,48,51,54,57
  147.     dc.w    60,63,66,69,72,75,77,80
  148.     dc.w    83,86,88,91,93,96,98,100
  149.     dc.w    102,104,106,108,110,111,113,114
  150.     dc.w    115,116,117,118,119,119,120,120
  151.     even
  152. sl=*-sintab        
  153.  
  154.